package com.example.arcapplication.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.arcapplication.bean.DataList;
import com.example.arcapplication.bean.HwList;
import com.example.arcapplication.bean.Inventory;
import com.example.arcapplication.bean.StockList;

import com.example.arcapplication.db.DataListDao;
import com.example.arcapplication.db.HwListDao;
import com.example.arcapplication.db.InventoryDao;
import com.example.arcapplication.db.StockListDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dataListDaoConfig;
    private final DaoConfig hwListDaoConfig;
    private final DaoConfig inventoryDaoConfig;
    private final DaoConfig stockListDaoConfig;

    private final DataListDao dataListDao;
    private final HwListDao hwListDao;
    private final InventoryDao inventoryDao;
    private final StockListDao stockListDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dataListDaoConfig = daoConfigMap.get(DataListDao.class).clone();
        dataListDaoConfig.initIdentityScope(type);

        hwListDaoConfig = daoConfigMap.get(HwListDao.class).clone();
        hwListDaoConfig.initIdentityScope(type);

        inventoryDaoConfig = daoConfigMap.get(InventoryDao.class).clone();
        inventoryDaoConfig.initIdentityScope(type);

        stockListDaoConfig = daoConfigMap.get(StockListDao.class).clone();
        stockListDaoConfig.initIdentityScope(type);

        dataListDao = new DataListDao(dataListDaoConfig, this);
        hwListDao = new HwListDao(hwListDaoConfig, this);
        inventoryDao = new InventoryDao(inventoryDaoConfig, this);
        stockListDao = new StockListDao(stockListDaoConfig, this);

        registerDao(DataList.class, dataListDao);
        registerDao(HwList.class, hwListDao);
        registerDao(Inventory.class, inventoryDao);
        registerDao(StockList.class, stockListDao);
    }
    
    public void clear() {
        dataListDaoConfig.clearIdentityScope();
        hwListDaoConfig.clearIdentityScope();
        inventoryDaoConfig.clearIdentityScope();
        stockListDaoConfig.clearIdentityScope();
    }

    public DataListDao getDataListDao() {
        return dataListDao;
    }

    public HwListDao getHwListDao() {
        return hwListDao;
    }

    public InventoryDao getInventoryDao() {
        return inventoryDao;
    }

    public StockListDao getStockListDao() {
        return stockListDao;
    }

}
